package au.edu.swin.swinvehicle.bookingtype;

import java.io.Serializable;

/**
 * BookingType tranfer object. This is the brief information of booking type.
 * It might be used for drop down box for selecting booking type.
 * @version 1.0
 * @author Dany Gunawan
 * @lastmodify 2009-05-12
 */
// We will make the class Serializable so we can easily send it to remote clients.
public class BookingTypeTO implements Serializable {

    private Long id;
    private String code;

    /** Creates a new instance of BookingTypeTO */
    public BookingTypeTO(Long id, String code) throws BookingTypeManagerException {
        try {
            this.id = id;
            this.setCode(code);
        } catch (Exception e) {
            throw new BookingTypeManagerException("Cannot instantiate new BookingTypeTO object", e);
        }
    }

    public Long getId() {
        return id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) throws BookingTypeManagerException {
        this.code = code;
    }
}
